{extend name="layout/layout"}
{block name="content"}
<main class="user_page  ">
    <section class="">
        <div class="layui-main">
            <div class="user_con">
                <div class="user_headpage" data-load="active_header">
                    {include file="user_activity/header" menu="home" /}
                </div>
                <div class="right_main ">

                    <p class="ft24 mb10 ft-bold">主頁</p>
                    <p class="ft14 gary_c9 mb20 ft-bold">你可以在這裡管理跟 ACCUPASS 帳號有關的所有設定。</p>
                    <div class="block_com mb20">
                       <div class="d-flex al-c">
                          <div class="user_img mr15" style="width: 0.5rem;">
                              {if $user.profile !=''} 
                                  <img src="{$user.profile}" style="width: 50;height: 50px;border-radius: 50%;">
                                  {else /} 
                                  <img src="__ROOT__/public/activity/images/user3.png">
                              {/if}
                     
                          </div>
                          <p class="ft18 ft-bold">{$user.name}</p>
                       </div>
  
                    </div>
                    <div class="block_com mb20">
                       <p class="ft18 ft-bold mb30">活動清單</p>
                       <from class="layui-form">
                          <div class="ticket_ul2 ar_table">
                             <table class="layui-table tac al_table ft-bold" lay-skin="nob">
                                <colgroup>
  
                                   <col width="180">
                                   <col width="150">
                                   <col width="150">
                                   <col width="150">
                                   <col width="120">
                                </colgroup>
                                <thead>
                                   <tr>
                                      <th>
                                         <div class="tac">日期</div>
                                      </th>
                                      <th>
                                         <div class="tac">名稱</div>
                                      </th>
                                      <th>
                                         <div class="tac">已報名</div>
                                      </th>
                                      <th>
                                         <div class="tac">報名人數上限</div>
                                      </th>
                                      <th>
                                         <div class="tac">狀態</div>
                                      </th>
                                   </tr>
                                </thead>
                                <tbody>
                                 {if count($acts)} 
                                 {volist name="$acts" id="vo"} 
                                 <tr>
                                    <td>
                                        {$vo.begin_time}
                                    </td>
                                    <td>
                                       <div class="d-flex al-c td_label ut_table">
                                          <div class="label_ut1" status="{$vo.sale_status}">
                                             {$vo.status_name}
                                          </div>
                                          <div>
                                             <p class="ft13">{$vo.name}</p>
                                          </div>
                                       </div>
                                    </td>
                                    <td>
                                       {$vo.order_count}
                                    </td>
                                    <td>
                                       {$vo.ticket_count}
                                    </td>
                                    <td>
                                       {$vo.status_name}<br> {$vo.un_public == 1 ? '非公開' : '公開'} 
                                    </td>
                                 </tr>
                                 {/volist}
                                 {/if}
                                </tbody>
                             </table>
                          </div>
  
                       </from>
                    </div>
                    <ul class="layui-row layui-col-space20 ul_height">
                       <li class="layui-col-md6 layui-col-xs12">
                          <div class="item block_com">
                             <p class="ft18 ft-bold mb30">活動摘要</p>
                             <dl class="alt_ul1">
                              {if count($acts)} 
                                 {volist name="$acts" id="vo"}  
                                 <dd>
                                    <a class="item" href="/activity/user/activity/{$vo.id}/overview">
                                       <div class="layui-elip t1">{$vo.name}</div>
                                       <div class="t2">{$vo.begin_time}</div>
                                    </a>
                                 </dd>
                              {/volist}
                              {/if}
                               
                             </dl>
                             <div class="text-align-right mt10">
                                <a href="/activity/user/active_list.html" class="ft12 gary_c9 orange_c ">更多</a>
                             </div>
                          </div>
  
                       </li>
                       <li class="layui-col-md6 layui-col-xs12">
                          <div class="item block_com d-flex flex-column">
                             <p class="ft18 ft-bold mb30">你管理的主辦單位</p>
                             <dl class="alt_ul1 flex-1">
                              {if(count($companys))}
                                 {volist name="companys" id="vo"}  
                                    <dd>
                                       <a class="item" href="">
                                          <div class="layui-elip t1">{$vo.name}</div>
                                       </a>
                                    </dd>
                                 {/volist}
                              {/if}
                             </dl>
                             <div class="text-align-right mt10 {if !in_array(1,$user.roles)} layui-hide {/if}" >
                                <a href="/activity/user/organizer.html" class="ft12 gary_c9 orange_c "><i
                                      class="mr5 layui-icon layui-icon-add-circle-fine"></i> 建立新主办</a>
                             </div>
                          </div>
  
                       </li>
                    </ul>
                 </div>
                <!-- <div class="right_main ">
                    <p class="ft24 mb10 ft-bold">活動列表</p>
                    <div class="block_com" style="min-height: 60vh;">
                        <from class="layui-form">

                            <div class="ticket_ul2 ar_table">
                                <table class="layui-table tac al_table ft-bold" lay-skin="nob">
                                    <thead>
                                    <tr>
                                        <th>
                                            <div class="">活动名称</div>
                                        </th>
                                        <th>
                                            <div class="tac">活动时间</div>
                                        </th>
                                        <th>
                                            <div class="tac">创建时间</div>
                                        </th>
                                        <th>
                                            <div class="tac">创建者</div>
                                        </th>
                                        <th></th>
                                    </tr>
                                    </thead>
                                    <tbody>
                                    {foreach $acts as $act}
                                    <tr>
                                        <td>{$act.name}</td>
                                        <td>{$act.begin_time} - {$act.end_time}</td>
                                        <td>{$act.create_time}</td>
                                        <td>{$act.creator_name}</td>
                                        <td class="a_b1">
                                            <a href="/activity/user/activity/{$act.id}/overview.html">详情</a>
                                        </td>
                                    </tr>
                                    {/foreach}
                                    </tbody>
                                </table>
                            </div>

                        </from>
                    </div>
                </div> -->
            </div>
        </div>
    </section>
</main>
<script>
    $(document).on('click', '[data-btn="select"]', function () {
        var disabled = $(this).attr('data-status')
        if (disabled == 'disabled') {
            return;
        }
        $(this).toggleClass('icon-selected')
    })
</script>
{/block}